/*
 * @FilePath: rem.ts
 * @Author: jack
 * @Date: 2024-06-06 16:32:34
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-07-09 13:49:12
 * Copyright: 2024 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 
 */
/*
 * @FilePath: rem.ts
 * @Author: jack
 * @Date: 2024-05-18 10:00:15
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2024-05-18 10:00:21
 * Copyright: 2024 xxxTech CO.,LTD. All Rights Reserved.
 * @Descripttion: 
 */
export default {
    // 设置 rem 函数
    setRem() {
        const baseSize = 16
        // 当前页面宽度相对于 1920 宽的缩放比例，可根据自己需要修改。
        const scale = document.documentElement.clientWidth / 1920
        // 设置页面根节点字体大小
        document.documentElement.style.fontSize =
            baseSize * Math.min(scale, 2) + 'px'
    }
}

// // 初始化
// setRem()
// // 改变窗口大小时重新设置 rem
// window.onresize = function () {
//     setRem()
// }
